﻿@{
    ViewBag.Title = "Designation";   
 }
 <h1>
    Manage Designations</h1>
<div align="center">
    <table id="jqgDesignations" cellpadding="0" cellspacing="0">
    </table>
    <div id="jqgpDesignations" style="text-align: center;">
    </div>
</div>
@section JavaScript{
    <script type="text/javascript">
        $(document).ready(function () {
            $('#jqgDesignations').jqGrid({
                //url from which data should get
                url: '@Url.Action("Designations")',
                //type of data
                datatype: 'json',
                //url access method type
                mtype: 'POST',
                //columns names
                colNames: ['Designation Id', 'Designation Name'],
                //columns model
                colModel: [
                    { name: 'DesignationId', index: 'DesignationId', align: 'left', editable: false },
                    { name: 'DesignationName', index: 'DesignationName', align: 'left', editable: true, edittype: 'text',
                        editoptions: { maxlength: 40
                        },
                        editrules: { required: true }
                    }
                ],
                //pager for grid
                    pager: $('#jqgpDesignations'),
                //number of rows per page
                rowNum: 5,
                //initial sorting column
                sortname: 'DesignationId',
                //initial sorting direction
                sortorder: 'asc',
                //we want to display total record count
                viewrecords: true,
                //grid height
                height: '100%'
            });
            $('#jqgDesignations').jqGrid('navGrid', '#jqgpDesignations',
                { add: true, del: true, edit: true, search: false },
                { width: 'auto', url: '@Url.Action("UpdateDesignation")' },
                { width: 'auto', url: '@Url.Action("InsertDesignation")' },
                { width: 'auto', url: '@Url.Action("DeleteDesignation")' });
        });
    </script>
}
@section PageDescription{
    <h1>
        Designation</h1>
    <h3>
        User Designation</h3>
    <p>
        Describes various designations of an employee, designation name can be added,
         deleted or edited and designationid is unique for each employee.</p>
}


